import { BY_TYPE_URL, PRODUCT_BY_ID, SEARCH_DES_URL, TEST_URL } from "../config/urls.cfg";
import request from "./ajax";

/** 获取商品类型 */
export function getTypeApi():Promise<any>{
    return request({url:TEST_URL})
}

/** 获取某一类商品 */
export function getByTypeApi(type:string):Promise<any>{
    return request({
        url:BY_TYPE_URL,
        params:{type}
    })
}
/** 搜索某一类商品 */
export function getSearDeseApi(des:string):Promise<any>{
    return request({
        url:SEARCH_DES_URL,
        params:{des}
    })
}
/** 商品详情 */
export function getProById(id:any){
    return request({
        url: PRODUCT_BY_ID,
        params: {id}
    })
}